home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / bsd / rpcsvc / rex.x < prev    next >
Text File  |  1990-01-29  |  6KB  |  205 lines

  1. /*    @(#)rex.x    1.2 88/05/08 4.0NFSSRC SMI    */
  2.  
  3. /* 
  4.  * Copyright (c) 1988 by Sun Microsystems, Inc.
  5.  * @(#) from SUN 1.4
  6.  */
  7.  
  8. /*
  9.  * Remote execution (rex) protocol specification
  10.  */
  11.  
  12. const STRINGSIZE = 1024;
  13. typedef string rexstring<1024>;
  14.  
  15. /*
  16.  * values to pass to REXPROC_SIGNAL
  17.  */
  18. const SIGINT = 2;    /* interrupt */
  19.  
  20. /*
  21.  * Values for rst_flags, below 
  22.  */
  23. const REX_INTERACTIVE = 1;    /* interactive mode */
  24.  
  25. struct rex_start {
  26.     rexstring rst_cmd<>;    /* list of command and args */
  27.     rexstring rst_host;    /* working directory host name */
  28.     rexstring rst_fsname;    /* working directory file system name */
  29.     rexstring rst_dirwithin;/* working directory within file system */
  30.     rexstring rst_env<>;    /* list of environment */
  31.     unsigned int rst_port0;    /* port for stdin */
  32.     unsigned int rst_port1;    /* port for stdout */
  33.     unsigned int rst_port2;    /* port for stderr */
  34.     unsigned int rst_flags;    /* options - see const above */
  35. };
  36.  
  37. struct rex_result {
  38.        int rlt_stat;        /* integer status code */
  39.     rexstring rlt_message;    /* string message for human consumption */
  40. };
  41.  
  42.  
  43. struct sgttyb {
  44.     unsigned four;    /* always equals 4 */
  45.     opaque chars[4];
  46.     /* chars[0] == input speed */
  47.     /* chars[1] == output speed */
  48.     /* chars[2] == kill character */
  49.     /* chars[3] == erase character */
  50.     unsigned flags;
  51. };
  52. /* values for speeds above (baud rates)  */
  53. const B0  = 0;
  54. const B50 = 1;
  55. const B75 = 2;
  56. const B110 = 3;
  57. const B134 = 4;
  58. const B150 = 5;
  59. const B200 = 6;
  60. const B300 = 7;
  61. const B600 = 8;
  62. const B1200 = 9;
  63. const B1800 = 10;
  64. const B2400 = 11;
  65. const B4800 = 12;
  66. const B9600 = 13;
  67. const B19200 = 14;
  68. const B38400 = 15;
  69.  
  70. /* values for flags above */
  71. const TANDEM = 0x00000001; /* send stopc on out q full */
  72. const CBREAK = 0x00000002; /* half-cooked mode */
  73. const LCASE = 0x00000004; /* simulate lower case */
  74. const ECHO = 0x00000008; /* echo input */
  75. const CRMOD = 0x00000010; /* map \r to \r\n on output */
  76. const RAW = 0x00000020; /* no i/o processing */
  77. const ODDP = 0x00000040; /* get/send odd parity */
  78. const EVENP = 0x00000080; /* get/send even parity */
  79. const ANYP = 0x000000c0; /* get any parity/send none */
  80. const NLDELAY = 0x00000300; /* \n delay */
  81. const  NL0 = 0x00000000;
  82. const  NL1 = 0x00000100; /* tty 37 */
  83. const  NL2 = 0x00000200; /* vt05 */
  84. const  NL3 = 0x00000300;
  85. const TBDELAY = 0x00000c00; /* horizontal tab delay */
  86. const  TAB0 = 0x00000000;
  87. const  TAB1 = 0x00000400; /* tty 37 */
  88. const  TAB2 = 0x00000800;
  89. const XTABS = 0x00000c00; /* expand tabs on output */
  90. const CRDELAY = 0x00003000; /* \r delay */
  91. const  CR0 = 0x00000000;
  92. const  CR1 = 0x00001000; /* tn 300 */
  93. const  CR2 = 0x00002000; /* tty 37 */
  94. const  CR3 = 0x00003000; /* concept 100 */
  95. const VTDELAY = 0x00004000; /* vertical tab delay */
  96. const  FF0 = 0x00000000;
  97. const  FF1 = 0x00004000; /* tty 37 */
  98. const BSDELAY = 0x00008000; /* \b delay */
  99. const  BS0 = 0x00000000;
  100. const  BS1 = 0x00008000;
  101. const CRTBS = 0x00010000; /* do backspacing for crt */
  102. const PRTERA = 0x00020000; /* \ ... / erase */
  103. const CRTERA = 0x00040000; /* " \b " to wipe out char */
  104. const TILDE = 0x00080000; /* hazeltine tilde kludge */
  105. const MDMBUF = 0x00100000; /* start/stop output on carrier intr */
  106. const LITOUT = 0x00200000; /* literal output */
  107. const TOSTOP = 0x00400000; /* SIGTTOU on background output */
  108. const FLUSHO = 0x00800000; /* flush output to terminal */
  109. const NOHANG = 0x01000000; /* no SIGHUP on carrier drop */
  110. const L001000 = 0x02000000;
  111. const CRTKIL = 0x04000000; /* kill line with " \b " */
  112. const PASS8 = 0x08000000;
  113. const CTLECH = 0x10000000; /* echo control chars as ^X */
  114. const PENDIN = 0x20000000; /* tp->t_rawq needs reread */
  115. const DECCTQ = 0x40000000; /* only ^Q starts after ^S */
  116. const NOFLSH = 0x80000000; /* no output flush on signal */
  117.  
  118. struct tchars {
  119.     unsigned six;    /* always equals 6 */
  120.     opaque chars[6];
  121.     /* chars[0] == interrupt char */
  122.     /* chars[1] == quit char */
  123.     /* chars[2] == start output char */
  124.     /* chars[3] == stop output char */
  125.     /* chars[4] == end-of-file char */
  126.     /* chars[5] == input delimeter (like nl) */
  127. };
  128.  
  129. struct ltchars {
  130.     unsigned six;    /* always equals 6 */
  131.     opaque chars[6];
  132.     /* chars[0] == stop process signal */
  133.     /* chars[1] == delayed stop process signal */
  134.     /* chars[2] == reprint line */
  135.     /* chars[3] == flush output */
  136.     /* chars[4] == word erase */
  137.     /* chars[5] == literal next character */
  138.     unsigned mode;
  139. };
  140.  
  141. struct rex_ttysize {
  142.     int ts_lines;
  143.     int ts_cols;
  144. };
  145.  
  146. struct rex_ttymode {
  147.     sgttyb basic;    /* standard unix tty flags */
  148.     tchars more; /* interrupt, kill characters, etc. */
  149.     ltchars yetmore; /* special Berkeley characters */
  150.     unsigned andmore;     /* and Berkeley modes */
  151. };
  152.  
  153. /* values for andmore above */
  154. const LCRTBS = 0x0001;    /* do backspacing for crt */
  155. const LPRTERA = 0x0002;    /* \ ... / erase */
  156. const LCRTERA = 0x0004;    /* " \b " to wipe out char */
  157. const LTILDE = 0x0008;    /* hazeltine tilde kludge */
  158. const LMDMBUF = 0x0010;    /* start/stop output on carrier intr */
  159. const LLITOUT = 0x0020;    /* literal output */
  160. const LTOSTOP = 0x0040;    /* SIGTTOU on background output */
  161. const LFLUSHO = 0x0080;    /* flush output to terminal */
  162. const LNOHANG = 0x0100;    /* no SIGHUP on carrier drop */
  163. const LL001000 = 0x0200;
  164. const LCRTKIL = 0x0400;    /* kill line with " \b " */
  165. const LPASS8 = 0x0800;
  166. const LCTLECH = 0x1000;    /* echo control chars as ^X */
  167. const LPENDIN = 0x2000;    /* needs reread */
  168. const LDECCTQ = 0x4000;    /* only ^Q starts after ^S */
  169. const LNOFLSH = 0x8000;    /* no output flush on signal */
  170.  
  171. program REXPROG {
  172.     version REXVERS {
  173.  
  174.         /*
  175.          * Start remote execution
  176.          */
  177.         rex_result 
  178.         REXPROC_START(rex_start) = 1;
  179.  
  180.         /*
  181.          * Wait for remote execution to terminate
  182.          */
  183.         rex_result
  184.         REXPROC_WAIT(void) = 2;
  185.  
  186.         /*
  187.          * Send tty modes
  188.          */
  189.         void
  190.         REXPROC_MODES(rex_ttymode) = 3;
  191.  
  192.         /*
  193.          * Send window size change
  194.          */
  195.         void
  196.         REXPROC_WINCH(rex_ttysize) = 4;
  197.  
  198.         /*
  199.          * Send other signal
  200.          */
  201.         void
  202.         REXPROC_SIGNAL(int) = 5;
  203.     } = 1;
  204. } = 100017;
  205.